package server

import (
	"file_sys_server/api"

	"github.com/gin-gonic/gin"
)

// 方法路由配置
func NewRouter() *gin.Engine {
	router := gin.Default()

	group := router.Group("Dev/")
	{ // 127.0.0.1:8088/Dev/getFileList
		// group.GET("getSampleBean_MFDCG", api.GetSampleBean_MFDCG
		//测试
		group.GET("serverTest", api.HandleTest)
		group.POST("addSampleBean_MFDCG", api.AddSampleBean_MFDCG)
		group.POST("uploadFile_MFDCG", api.HandleUpLoadFile)
		group.POST("uploadMultiFiles_MFDCG", api.HandleUploadMultiFiles)
		group.GET("downloadFile", api.HandleDownloadFile)

		//获取说明文件和视频
		group.GET("downloadMultiFile", api.HandleZipDownloadFile)
		/* 样品与项目数据同步*/
		group.POST("addSmapleFromLocal_MFDCG", api.AddSampleBean_FromLocal_MFDCG)
		group.GET("getSampleList_MFDCG", api.GetSampleList_MFDCG)
		group.POST("addProjectFromLocal_MFDCG", api.AddProjectBean_FromLocal_MFDCG)
		group.GET("getProjectList_MFDCG", api.GetProjectList_MFDCG)

		/*
			三联卡项目数据同步
		*/
		group.POST("addUnionProjectFromLocal_MFDCG", api.AddUnionProjectBean_FromLocal_MFDCG)
		group.GET("getUnionProjectList_MFDCG", api.GetUnionProjectList_MFDCG)

		/*
			校准数据部分同步
		*/
		group.POST("uploadChannel1Calibration_MFDCG", api.AddChannle1Calibration_MFDCG)
		group.POST("uploadChannel2Calibration_MFDCG", api.AddChannle2Calibration_MFDCG)
		group.POST("uploadChannel3Calibration_MFDCG", api.AddChannle3Calibration_MFDCG)
		group.POST("uploadChannel4Calibration_MFDCG", api.AddChannle4Calibration_MFDCG)
		group.POST("uploadChannel1SpecCalibration_MFDCG", api.AddChannle1SpecCalibration_MFDCG) // 左侧单卡
		group.POST("uploadChannelSpecCalibration_MFDCG", api.AddChannleSpecCalibration_MFDCG)   // 裸条

		/*获取校准数据*/
		group.GET("GetChannel1Calibration_MFDCG", api.GetChannel1_MFDCG)
		group.GET("GetChannel2Calibration_MFDCG", api.GetChannel2_MFDCG)
		group.GET("GetChannel3Calibration_MFDCG", api.GetChannel3_MFDCG)
		group.GET("GetChannel4Calibration_MFDCG", api.GetChannel4_MFDCG)
		group.GET("GetChannel1SpecCalibration_MFDCG", api.GetChannel1Spec_MFDCG) // 左侧单卡
		group.GET("GetChannelSpecCalibration_MFDCG", api.GetChannel1Spec_MFDCG)  // 裸条

		group.GET("GetApk_MFDCG", api.HandleDownloadApkFile) // 获取更新文件
	}
	return router
}
